package com.example.ccsystem.controller;

import com.example.ccsystem.entity.Lesson;
import com.example.ccsystem.service.LessonService;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/Lesson")
public class LessonController {
    @Autowired
    private LessonService service;

    @ApiOperation(value="获取课程总数",notes = "")
    @RequestMapping(value = "/getAllLessons",method = RequestMethod.GET)
    public String getAllLessons(){
        return service.getAllLessons();
    }

    @ApiOperation(value="获取课程列表",notes="")
    @RequestMapping(value = "/",method = RequestMethod.GET)
    public List<Map<String,Object>> findAllLessons(){
        List<Map<String,Object>> list=service.findAllLesson();
        return list;
    }
}
